
import java.rmi.RemoteException;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import java.rmi.server.UnicastRemoteObject;
import java.util.HashSet;

/**
 *
 * @author olivierm
 */
public class ClientImpl extends PublisherImpl implements Client{
    
    private String _nom;
    private String _prénom;
    private String _téléphone;
    private String _adresse;
    private HashSet<String> _uneListe;
    
    public ClientImpl (String nom, String prénom, String mobile, String adresse)throws RemoteException{
            super();
            this._nom = nom;
            this._prénom = prénom;
            this._téléphone = mobile;
            this._adresse = adresse;
            this._uneListe = new HashSet<String>();
            UnicastRemoteObject.exportObject(this);
    }
    
    public boolean modifierClient(String nom, String prénom, String mobile, String adresse) throws RemoteException {
        try{
            this._nom = nom;
            this._prénom = prénom;
            this._téléphone = mobile;
            this._adresse = adresse;
            return true;
        }catch (Exception ex){
            ex.printStackTrace();
        }
        return false;
    }

    public String getNom() throws RemoteException {
        return this._nom;
    }

    public String getPrénom() throws RemoteException {
        return this._prénom;
    }

    public String getTéléphone() throws RemoteException {
        return this.getTéléphone();
    }

    public String getAdresse() throws RemoteException {
        return this._adresse;
    }

    public HashSet<String> getUneListe() throws RemoteException{
        return _uneListe;
    }

}
